$(document).ready(function() {
    setInterval(function() {
        $(".main-right .general-info .personal .user a").each(function() {
            $(this).animate({
                top: "35px"
            },
            200).animate({
                top: "45px"
            },
            200).animate({
                top: "40px"
            },
            200).animate({
                top: "45px"
            },
            200)
        })
    },
    3E3);
    $(".fixed-right1 ul li").hover(function() {
        $(this).css("background-position-y", "-500px")
    },
    function() {
        $(this).css("background-position-y", "-450px")
    });
    $(".fixed-right1 .collect").on("click",
    function() {
        $(".fixed-right1").animate({
            right: "-60px"
        },
        200);
        setTimeout(function() {
            $(".fixed-right2").animate({
                right: "-35px"
            },
            100)
        },
        300)
    });
    $(".fixed-right2").on("mouseover",
    function() {
        $(this).animate({
            right: "-70px"
        },
        100);
        setTimeout(function() {
            $(".fixed-right1").animate({
                right: "0px"
            },
            200)
        },
        100)
    });
    var a = $(".vertical-roll")[0];
    if ("undefined" != typeof a) {
        var b = function() {
            Time = setInterval(function() {
                a.offsetTop <= -a.offsetHeight / 2 && (a.style.top = "0px");
                a.style.top = a.offsetTop - 1 + "px"
            },
            50)
        },
        c = $(".vertical-roll li")[0];
        a.style.height = c.offsetHeight * c.length + "px";
        b();
        a.onmouseover = function() {
            clearInterval(Time)
        };
        a.onmouseout = function() {
            b()
        }
    }
    $(".third-bind .title span").click(function() {
        index = $(this).parent().children().index($(this));
        $(".third-bind .con .txt").eq(index).fadeIn().siblings().hide();
        $(this).addClass("popup-line").siblings().removeClass("popup-line")
    });
    $(".acc .line p a").click(function() {
        index = $(this).index();
        $(".switch66").eq(index).show().siblings().hide();
        $(this).addClass("switch-on").siblings().removeClass("switch-on")
    });
    $(".sign-bj .sign-box .sign-date ul li:nth-child(7n)").css("margin-right", "0px");
    $("ul.platform-index li a").hover(function() {
        $(this).find("span.but").stop().animate({
            left: "154px"
        },
        1E3);
        $(this).find(".img .hide").stop().animate({
            opacity: "0.9"
        },
        1E3);
        $(this).find(".txt").stop().fadeOut();
        $(this).find("span.but").rotate({
            animateTo: 360,
            easing: function(d, e, a, b, c) {
                return e / c * b + a
            }
        })
    },
    function() {
        $(this).find("span.but").stop().animate({
            left: "-20px"
        },
        1E3);
        $(this).find(".img .hide").stop().animate({
            opacity: "0"
        },
        1E3);
        $(this).find(".txt").stop().fadeIn();
        $(this).find("span.but").rotate({
            animateTo: 0,
            easing: function(d, e, a, b, c) {
                return e / c * b + a
            }
        })
    });
    $(".platform-index li .img").each(function(d) {
        $(this).css("background-position-y", -55 * d + "px")
    });
    $(".platform li:nth-child(4n)").css("margin-right", "0px");
    $(".platform-list .platform li").hover(function() {
        $(this).children(".hide").stop().animate({
            bottom: "0px"
        },
        500);
        $(this).children(".txt").addClass("blur")
    },
    function() {
        $(this).children(".hide").stop().animate({
            bottom: "-200px"
        });
        $(this).children(".txt").removeClass("blur")
    });
    $(".platform-jq li:nth-child(3)").css("margin-right", "0px");
    $(".platform-jq li").hover(function() {
        $(this).children(".hide").stop().animate({
            bottom: "0px"
        },
        500);
        $(this).children(".txt").addClass("blur")
    },
    function() {
        $(this).children(".hide").stop().animate({
            bottom: "-200px"
        });
        $(this).children(".txt").removeClass("blur")
    });
    $(".funding-jq li").hover(function() {
        $(this).find(".cover").stop(!0).animate({
            left: "0px"
        },
        300);
        $(this).find(".con").css("border-left", "1px solid #fff");
        $(this).find("p").stop(!0).fadeIn(1E3)
    },
    function() {
        $(this).find(".cover").stop(!0).animate({
            left: "78%"
        },
        300);
        $(this).find(".con").css("border-left", "1px solid rgba(0,0,0,0)");
        $(this).find("p").stop(!0).fadeOut()
    });
    $(".funding-vertical li").hover(function() {
        $(this).find(".img-bj").stop(!0).fadeIn()
    },
    function() {
        $(this).find(".img-bj").stop(!0).fadeOut()
    });
    $("#tab a b").each(function(d, a) {
        $(this).css("background-position", -30 * d + "px " + (d == $(".hover").index() ? -33 : 3) + "px ")
    });
    $("#tab a:not(.hover)").hover(function(d, a) {
        $("b", this).css("background-position", $("b", this).css("background-position").replace(" 3px", " -33px"))
    },
    function(a, b) {
        $("b", this).css("background-position", $("b", this).css("background-position").replace(" -33px", " 3px"))
    });
    $(".x-main-upper .xmu-product ul li").hover(function() {
        $(this).find(".goods-img-bj").stop(!0).animate({
            top: "0"
        },
        300)
    },
    function() {
        $(this).find(".goods-img-bj").stop(!0).animate({
            top: "149px"
        },
        200)
    });
    $("#person a b").each(function(a, b) {
        $(this).css("background-position", -30 * a + "px " + (a == $(".hover").index() ? -110 : -75) + "px ")
    });
    $("#person a:not(.hover)").hover(function(a, b) {
        $("b", this).css("background-position", $("b", this).css("background-position").replace("-75px", "-110px"))
    },
    function(a, b) {
        $("b", this).css("background-position", $("b", this).css("background-position").replace("-110px", "-75px"))
    });
    $sSel = $(".information-con .I_Select span.I_S_Box");
    $sSel.click(function() {
        var a = $(this).children("input").attr("data-type"),
        b = "";
        0 == $(this).attr("data-status") ? ($(this).css("background-position", "-270px -45px"), $(this).attr("data-status", 1)) : ($(this).css("background-position", "-255px -45px"), $(this).attr("data-status", 0));
        b = 1 == a ? $(this).parent().parent().children().find(".sms") : $(this).parent().parent().children().find(".notice");
        b.each(function() {
            var a = $(this)[0];
            a.checked = a.checked ? !1 : !0
        })
    });
    $("body").delegate(".information-con ul.Inftxt li span.InfBtn", "click",
    function() {
        var a = $(this);
        if (1 == a.attr("data-status")) $(this).children("p").text("\u5c55\u5f00\u67e5\u770b\u4fe1\u606f"),
        $(this).parent().find(".txt").css("width", "47%"),
        $(this).parent().find(".txt-title").css("width", ""),
        $(this).parent().find(".txt-title .content").css({
            width: "355px",
            height: "17px"
        }),
        a.attr("data-status", 0);
        else {
            var b = $(this).children("p"),
            c = {};
            b.text("\u6536\u8d77");
            $(this).parent().find(".txt").css("width", "100%");
            $(this).parent().find(".txt-title").css("width", "94%");
            $(this).parent().find(".txt-title .content").css({
                width: "100%",
                height: "100%"
            });
            a.attr("data-status", 1);
            0 == b.attr("data-status") && (b.attr("data-status", 1), a.parent("li").children().find("b.is-see-status").removeClass("icon-unread").addClass("icon-read"), a.parent("li").children().find("i.is-see").html("\u5df2\u8bfb"), c.ids = b.attr("data-id"), 1 == b.attr("type") ? doRequest("/user/set_sms_status.html", c, !0,
            function() {},
            function() {}) : doRequest("/user/set_notice_status.html", c, !0,
            function() {},
            function() {}))
        }
    });
//  $("#help-tab a b").each(function(a, b) {
//      $(this).css("background-position", -20 * a + "px " + ($(this).parent().hasClass("helplist-click") ? -231 : -202) + "px ")
//  });
//  $("#help-tab a:not(.helplist-click)").hover(function(a, b) {
//      $("b", this).css("background-position", $("b", this).css("background-position").replace("-202px", "-231px"))
//  },
//  function(a, b) {
//      $("b", this).css("background-position", $("b", this).css("background-position").replace("-231px", "-202px"))
//  });
    $(".help .help-con h4").click(function() {
        $(this).parent().children(".help-txt").toggle()
    });
    $(".card-more").click(function() {
        var a = $(".credit-classify-more").height(),
        b = $(".credit-classify-more ul").height();
        13 == a ? $(".credit-classify-more").height(b) : $(".credit-classify-more").animate({
            height: "13px"
        })
    });
    $(".drop-down").click(function() {
        $(".credit-card-type2").toggle();
        $(".drop-down .icon-open").toggleClass("icon-open-s")
    });
    $(".add-address span").click(function() {
        $("#show-add").show();
        $(".add-address").hide()
    });
    $("#show-add ul li .cancel-add,#show-add .icon-back").click(function() {
        $("#show-add").hide();
        $(".add-address").show()
    })
});
function showExchangePop(a) {
    var b = $(a);
    a = b.attr("data-type");
    var c = b.attr("data-pro-id"),
    d = b.attr("data-pro-title"),
    b = b.attr("data-pro-prize"),
    e = "",
    e = "en" == a ? e + ("<div class='popup-exchange popup-box' style='display: block;'><div class='p20'>    <div class='title mb10'>        <span class='fl popup-line mr10'>" + d + "        </span>        <a href='#' class='fr icon icon-close popup-close'></a>    </div>    <div class='con'>        <div class='txt'>            <form method='post' id='tan-exchange-form' action=''>            <div class='frame-box pud10'>                <b class='icon icon-input-user'></b>                <input type='text' name='name' value='" + address_default.name + "' placeholder='\u6536\u4ef6\u4eba\u59d3\u540d' class='required'/><br />            </div>            <div class='frame-box pud10'>                <b class='icon icon-input-call'></b>                <input type='text' name='phone' value='" + address_default.mobile + "' placeholder='\u6536\u4ef6\u4eba\u624b\u673a\u53f7' class='required'/><br />            </div>            <div class='frame-box pud10'>                <b class='icon icon-input-add'></b>                <input type='text' name='address' value='" + address_default.address + "' placeholder='\u6536\u8d27\u4eba\u5730\u5740' class='required'/><br />            </div>            <div class='frame-box pud10'>                <b class='icon icon-input-pass'></b>                <input name='proId' type='hidden' value='" + c + "'>                <input name='type' type='hidden' value='" + a + "'>                <input type='password' name='payPass' value='' maxlength='6' placeholder='6\u4f4d\u4ea4\u6613\u5bc6\u7801' class='required'/><br />            </div>            <p class='f14 mb10'>\u7269\u54c1\u4ef7\u683c\uff1a<i class='error'>" + b + "</i><b class='icon icon-tan66'></b></p>            <input type='submit' class='btn com-btn-valid' id='sub-exchange-form'  value='\u7acb\u5373\u5151\u6362'style='cursor:pointer;'/>            <a href='/user/security.html#four-bind' class='cancel-btn' target='_blank'>\u5fd8\u8bb0\u5bc6\u7801\uff1f</a>            <p class='error mt10'>\u6e29\u99a8\u63d0\u9192\uff1a</p>            <p class='tc'>\u8bf7\u586b\u5199\u771f\u5b9e\u7684\u6709\u6548\u4fe1\u606f\uff0c\u4ee5\u514d\u5956\u54c1\u65e0\u6cd5\u9001\u8fbe\u3002</p>            </form>        </div>    </div></div><script type='text/javascript' src='/static/default/js/exchange-en.js'>\x3c/script></div><div class='popup popup-box' style='display:block;'></div>") : e + ("<div class='popup-exchange popup-box' style='display: block;'><div class='p20'>        <div class='title mb10'>                <span class='fl popup-line mr10'>" + d + "                </span>                <a href='#' class='fr icon icon-close popup-close'></a>        </div>        <div class='con'>                <div class='txt'>                 <form method='post' id='tan-exchange-form' action=''>                        <div class='frame-box pud10'>                                <b class='icon icon-input-user'></b>                                <input name='proId' type='hidden' value='" + c + "'>                                <input name='type' type='hidden' value='" + a + "'>                                <input type='text' name='account' value='' placeholder='\u5145\u503c\u5e10\u53f7' class='required'/><br />                        </div>                        <div class='frame-box pud10'>                                <b class='icon icon-input-pass'></b>                                <input type='password' name='payPass' value='' maxlength='6' placeholder='\u4ea4\u6613\u5bc6\u7801' class='required'/><br />                        </div>                        <p class='f14 mb10'>\u7269\u54c1\u4ef7\u683c\uff1a<i class='error'>" + b + "</i><b class='icon icon-tan66'></b></p>                        <input type='submit' class='btn com-btn-valid' value='\u7acb\u5373\u5151\u6362' id='sub-exchange-form' style='cursor:pointer;'>                        <a href='/user/security.html#four-bind' class='cancel-btn' target='_blank'>\u5fd8\u8bb0\u5bc6\u7801\uff1f</a>                        <p class='error mt10'>\u6e29\u99a8\u63d0\u9192\uff1a</p>                        <p class='tc'>\u8bf7\u586b\u5199\u771f\u5b9e\u7684\u6709\u6548\u4fe1\u606f\uff0c\u4ee5\u514d\u5956\u54c1\u65e0\u6cd5\u9001\u8fbe\u3002</p>                </form>                </div>        </div></div><script type='text/javascript' src='/static/default/js/exchange-en.js'>\x3c/script></div><div class='popup popup-box' style='display:block;'></div>");
    $("body").find(".popup-box").remove().end().append(e)
}
function set_mark_read(a, b) {
    var c = $(a).parent().parent().children().find("input[type='checkbox']"),
    d = 0;
    b = b || "sms";
    var e = "";
    c.each(function() {
        var a = $(this);
        $(this)[0].checked && (d++, a.parent().parent().children().find(".is-see-status").hasClass("icon-unread") && (e += a.attr("data-id") + ",", a.parent().children(".is-see").html("\u5df2\u8bfb"), a.parent().parent().children().find("b.is-see-status").removeClass("icon-unread").addClass("icon-read"), a.parent().parent().children().find("p").attr("data-status", 1)))
    });
    0 == d ? layer.msg("\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u9009\u9879", {
        icon: 0,
        shift: 6,
        offset: 300,
        time: 2E3
    }) : "" != e ? (e = e.substring(0, e.length - 1), c = {},
    c.ids = e, c.type = b, layer.msg("\u8bbe\u7f6e\u6210\u529f", {
        icon: 1,
        offset: 300,
        time: 2E3
    }), doRequest("/user/set_read.html", c, !0,
    function() {},
    function() {})) : layer.msg("\u8bbe\u7f6e\u6210\u529f", {
        icon: 1,
        offset: 300,
        time: 2E3
    })
}
//文字超出多少字，省略号显示
function txtLimit(object,textLeng) {
    if(typeof arguments[0]=='object'){
        for (i = 0; i < arguments[0].length; i++) {
            var str = arguments[0][i].innerHTML;
            if (str.length > textLeng) {
                arguments[0][i].innerHTML = str.substring(0, textLeng) + "...";
            }
        }
    }else{
        return object.substring(0, textLeng) + "...";
    }
}
$(function() {
    $(".day-sign").click(function() {
        var a = this;
        1 == $(this).attr("data-status") ? doRequest("/user/do_mark.html", {
            stime: Math.random()
        },
        !1,
        function(b) {
            $(a).addClass("sign-btn-big2").removeClass("sign-btn-big1");
            $(".today").parent().append("<b></b>");
            $(".mark-count").html(b.mark_count);
            $(".sign-reward").children().find(".coin-s").html(b.coin);
            $(".sign-reward").children().find(".expe-s").html(b.expe);
            $(".sign-reward").children().find(".vip-icon-s").html(b.vip_coin);
            $(".sign-reward").children().find(".vip-expe-s").html(b.vip_expe);
            $(".sign-bj .sign-box .sign-reward").fadeIn()
        },
        function(a) {
            "10001" == a.errorCode ? showLogin("login") : layer.alert("\u4eca\u65e5\u5df2\u7b7e\u5230", {
                title: "\u5c0f6\u63d0\u793a",
                icon: 6,
                offset: 300
            },
            function() {
                window.location.reload()
            })
        }) : layer.alert("\u4eca\u65e5\u5df2\u7b7e\u5230", {
            title: "\u5c0f6\u63d0\u793a",
            icon: 6,
            offset: 300
        })
    });
    $(".receive-task-award").click(function() {
        var a = $(this).attr("data-action");
        $(this);
        var b = "" !== $(this).attr("data-step") ? parseInt($(this).attr("data-step")) : "";
        if ("" === b) return ! 1;
        doRequest(a, {
            step: b
        },
        !1,
        function(a) {
            $(".popup-new").children().find("p.title-s").html(a.step_title);
            $(".popup-new").children().find("i.coin-s").html(a.icon);
            $(".popup-new").children().find("i.exper-s").html(a.expe);
            $(".popup-box").delay(100).fadeIn()
        },
        errorCallback);
        return ! 1
    })
});
var oUl2 = document.getElementById("exper-list-near");
if ("undefined" != oUl2 && null != oUl2) {
    var auto2 = function() {
        Time2 = setInterval(function() {
            oUl2.offsetTop <= -oUl2.offsetHeight / 2 && (oUl2.style.top = "0px");
            oUl2.style.top = oUl2.offsetTop - 1 + "px"
        },
        30)
    },
    aLi2 = oUl2.getElementsByTagName("li");
    oUl2.innerHTML += oUl2.innerHTML;
    oUl2.style.height = aLi2[0].offsetHeight * aLi2.length + "px";
    auto2();
    oUl2.onmouseover = function() {
        clearInterval(Time2)
    };
    oUl2.onmouseout = function() {
        auto2()
    }
}
$(".fast-share li").click(function(a) {
    var b, c = "",
    d = encodeURIComponent($(".invite-href input").val()),
    e = encodeURIComponent("\u5f39\u6e9c\u6e9c\u7ea2\u5305\u58d5\u9001\uff0c\u62c6\u7ea2\u5305\u81f4\u624b\u62bd\u7b4b"),
    g = encodeURIComponent("\u5f39\u6e9c\u6e9c\uff0c\u513f\u65f6\u5feb\u4e50\u7684\u6307\u5c16\u56de\u5fc6\u3002\u5728\u8fd9\u91cc\u53d1\u73b0\u66f4\u591a\u5fd7\u8da3\u76f8\u6295\u7684\u4f19\u4f34\uff1b\u53c2\u4e0e\u6700\u524d\u6cbf\u7684\u4e92\u8054\u7f51\u91d1\u878d\u4f53\u9a8c\uff1b\u63a2\u7d22\u6700\u9177\u6700\u597d\u73a9\u7684\u751f\u6d3b..."),
    h = (encodeURIComponent("\u9001\u4f60\u4e00\u4e2a\u73b0\u91d1\u7ea2\u5305\uff0c\u5feb\u6765\u9886\uff01"), encodeURIComponent("http://www.tan66.com/static/default/img/banner/1.jpg")),
    f = encodeURIComponent("\u5f39\u6e9c\u6e9c\uff0c\u513f\u65f6\u5feb\u4e50\u7684\u6307\u5c16\u56de\u5fc6\u3002\u5728\u8fd9\u91cc\u53d1\u73b0\u66f4\u591a\u5fd7\u8da3\u76f8\u6295\u7684\u4f19\u4f34\uff1b\u53c2\u4e0e\u6700\u524d\u6cbf\u7684\u4e92\u8054\u7f51\u91d1\u878d\u4f53\u9a8c\uff1b\u63a2\u7d22\u6700\u9177\u6700\u597d\u73a9\u7684\u751f\u6d3b...");
    switch ($(this).attr("data-key")) {
    case "s0":
        b = "\u5f39\u6e9c\u6e9c-QQ\u597d\u53cb";
        c = String.Format("http://connect.qq.com/widget/shareqq/index.html?url={0}&desc=" + g + "&pic={2}&site=bshare", d);
        $(".mainInfo .appText").html(g);
        break;
    case "s2":
        b = "\u5f39\u6e9c\u6e9c-\u65b0\u6d6a";
        c = String.Format("http://service.weibo.com/share/share.php?url={0}&title=" + f + "&pic={2}", d, f, h);
        break;
    case "s3":
        b = "\u5f39\u6e9c\u6e9c-QQ\u7a7a\u95f4";
        c = String.Format("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url={0}&title=" + e + "&desc={1}&pics={2}&summary={1}", d, f, h);
        break;
    case "s1":
    case "s4":
        a = window.event || a;
        a.stopPropagation ? a.stopPropagation() : a.cancelBubble = !0;
        $(".ewm-box").show();
        break;
    default:
        return ! 1
    }
    if ("s1" != $(this).attr("data-key") && "s4" != $(this).attr("data-key")) {
        a = (window.screen.availHeight - 30 - 650) / 2;
        d = (window.screen.availWidth - 10 - 650) / 2;
        try {
            "\u5f39\u6e9c\u6e9c-" == b ? window.open(c, b, "width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no") : window.open(c, b, "width=700, height=680, top=" + a + ", left=" + d + ", toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no")
        } catch(k) {
            window.open(c)
        }
    }
    return ! 1
});
"undefined" != typeof $("#ewm")[0] && $("#ewm").qrcode({
    render: "table",
    width: 200,
    height: 200,
    text: $(".invite-href input").val()
});
$(".ewm-box").click(function(a) {
    a = window.event || a;
    a.stopPropagation ? a.stopPropagation() : a.cancelBubble = !0
});
document.onclick = function() {
    $(".ewm-box").hide()
};
var text = $(".propaganda-transverse .txt p");
if ("undefined" != typeof text) for (i = 0; i < text.length; i++) {
    var str = text[i].innerHTML;
    textLeng = 45;
    str.length > textLeng && (text[i].innerHTML = str.substring(0, textLeng) + "...")
};
$('.guide-bj .guide-tab ul li').on('click',
function() {
    $(this).addClass('guide-show').siblings().removeClass('guide-show');
    index = $(this).parent().children().index($(this));
    $(this).parents('.guide-bj3').find('.guide-img ul li').eq(index).fadeIn().siblings().hide()
});

(function($){
    var cd = function(O){
        var A = $("body").find(".check-mynum"),
        L = A.children().find(".num-list"),
        N = A.children().find(".num");
        L.html(O.codeStr),N.text(O.codeNum);
        A.fadeIn(400);
        $(document.body).click(function(){
            A.fadeOut();
        });
    }
    
    $(".see-code").on("click",function(){
        var S = $(this),
        I = S.attr("data-sid");
        var L = function(){
            doRequest("/ajax/ajax_user_code",{shopId:I},true,
                function(X){
                    cd(X);
                },function(X){});
        }
        L();
    });
})(jQuery);